#import "..//AtlTest//Obj//AtlTest.tlb" no_namespace, named_guids
#include <Windows.h>

int main()
{
    HRESULT hResult;
    IAtlObject* lpIAtlObject = nullptr;
    IAtlObject2* lpIAtlObject2 = nullptr;

    CoInitialize(0);

    do
    {
        hResult = CoCreateInstance(CLSID_AtlObject, nullptr, CLSCTX_INPROC_SERVER, 
            IID_IAtlObject, (void**)&lpIAtlObject);
        if (hResult != S_OK) break;

        hResult = CoCreateInstance(CLSID_AtlObject, nullptr, CLSCTX_INPROC_SERVER, 
            IID_IAtlObject2, (void**)&lpIAtlObject2);
        if (hResult != S_OK) break;

        lpIAtlObject->Test();
        lpIAtlObject2->Test2();

    } while (FALSE);

    if (lpIAtlObject)
        lpIAtlObject->Release();

    if (lpIAtlObject2)
        lpIAtlObject2->Release();

    CoUninitialize();

    return 0;
}